#include <iostream>
#include <stdlib.h>

using namespace std;


template <typename T>
class Stack
{
	Stack(const int& size = 100);
	~Stack();

	int Pop();
	void Push(const T&);

private:
	int top;
	int size;
	int* content;
};

template <typename T>
Stack<T>::Stack(const int& _size)
{
	top = 0;
	size = _size;
	content = new int[size];
}
template <typename T>

Stack<T>::~Stack()
{

}
template <typename T>
int Stack<T>::Pop()
{
	if (top >= 0)
		return content[top--];
}

template <typename T>
void Stack<T>::Push(const T& val)
{
	if ( top < size )
		content[++top] = val;
}